#!/usr/bin/env node

const http = require('http'),
  url = require('url');

//const addr = 'http://localhost:3000';
let msg = process.argv[2],
  opt = url.parse('http://local:8080');

opt.method = 'POST';

let req = http.request(opt,(res)=>{
  console.log(`HTTP/${res.httpVersion} ${res.statusCode} ${res.statusMessage}`);
  console.log(res.headers);
  console.log('');
  res.pipe(process.stdout);
});
req.end(msg + '\n');


